package Code.Day10_20241011.com.dx.day10;

public enum Genders {
    Male, Female;

    /**
     * 放回当前性别枚举类指示的性别
     *
     * @return 描述性别的字符串
     */
    public String getSex() {
        switch (this) {
            case Male -> {
                return "男";
            }
            case Female -> {
                return "女";
            }
            default -> {
                return "非法性别";
            }
        }
    }
}
